exports.LectureDetail_header = function(_args) {
	
	var aps='';
	if(Ti.Platform.osname== 'android') {
  		 Titanium.include('../globals.js');
  		 aps='../';
    }
    else {
   		  Titanium.include('globals.js');
    }
    
	var view = Ti.UI.createView({
	    backgroundImage: _args.backgroundImage,
	  
	   // backgroundColor:'white',
	    left: _args.left,
	    top: _args.top,
	    height:_args.height,
	    width: _args.width,//Globals.platformWidth,//'100%',
	    touchEnabled: _args.touchEnabled,//false
	});
	
	var view_Info = Ti.UI.createView({
	    backgroundColor:'transparent',
	    left: 0,
	    top: 0,
	    height:105,
	    width: _args.width,//Globals.platformWidth,//'100%',
	    touchEnabled: _args.touchEnabled,//false
	});
	
	
	
	
	var im = Titanium.UI.createView({
    
        backgroundImage:_args.backgroundImage_ImageTitle,
       	height:105,
        width:105,
        touchEnabled: true,
        top:0,
        left:0,
       
    });
	view_Info.add(im);
	
	
	
	
	var lbLectureName = Titanium.UI.createLabel({
       text:_args.lbLectureName,
       color:'black',
       left:107,
       top:10,
       font:{
			fontSize:Ti.App.Properties.getString('fontsizeLarge'),
			fontWeight:'bold'
		},
    });
    view_Info.add(lbLectureName)
    
	var lbPrice = Titanium.UI.createLabel({
       text:'Giá mua: '+_args.lbPrice+' VNĐ',
       color:'#1e6cc1',
       left:107,
       bottom:10,
       font:{
			fontSize:Ti.App.Properties.getString('fontsizeLarge'),
			fontWeight:'bold'
		},
    });
    view_Info.add(lbPrice)
	
	
	
	
	var view_button = Ti.UI.createView({
	    backgroundColor:'transparent',
	    left: 0,
	    top:view_Info.top+view_Info.height,
	    height:50,
	    width: Titanium.Platform.displayCaps.platformWidth,//'100%',//_args.width,//Globals.platformWidth,//'100%',
	    touchEnabled: _args.touchEnabled,//false
	});
	GetLoginPop = function(isCheck)
	{
		var table = Ti.UI.createTableView();
		var LoginPop = require('windows/LoginPop').CreateLoginPop
		var pop = new LoginPop({
	        title: Globals.login_login,
	        view: table,
	        top:0,
	        isCheck:isCheck,//0//Mua Bai Giang
	        LectureId:_args.LectureId
	    });
	    pop.open();
	}
	var btMuaBaiGiang = Titanium.UI.createButton({
		title:Globals.btMuaBaiGiang,
		font:{
				fontSize:Ti.App.Properties.getString('fontsizeDefault')//,
				//fontWeight:'bold'
			},
		backgroundImage: aps+Globals.backgroundImage_button,
		backgroundSelectedImage:aps+Globals.backgroundSelectedImage,
		backgroundDisabledImage: aps+Globals.backgroundDisabledImage,
		width:(Titanium.Platform.displayCaps.platformWidth)/4,//btwidth	,
		height:_args.btheight_button	,
		
	    left:0,
		color:Globals.foreColor
	});
	
	btMuaBaiGiang.addEventListener('click',function()
	{
	 
		 if (Ti.Network.online) {
		 //	alert(_args.LectureId)
			if(Ti.App.Properties.getInt('isLogin')==1)
			{
				
				 Ti.App.fireEvent('LectureDetail:btMuaBaiGiangPopup',{LectureId:_args.LectureId})
			}
			else{
				GetLoginPop(-1)
			}
		 }
		 else
		 {
		  	   require('settings').createAlertConnectError();
		 }
		
	})
	
	view_button.add(btMuaBaiGiang)
	
	
	var btSeeLecture = Titanium.UI.createButton({
		title:Globals.btSeeLecture_popup,
		font:{
								fontSize:Ti.App.Properties.getString('fontsizeDefault')//,
								//fontWeight:'bold'
			},
		backgroundImage:aps+Globals.backgroundImage_button,
		backgroundSelectedImage:aps+Globals.backgroundSelectedImage,
		backgroundDisabledImage: aps+Globals.backgroundDisabledImage,
		width:(Titanium.Platform.displayCaps.platformWidth)/4,//btwidth	,
		height:_args.btheight_button	,
		left: btMuaBaiGiang.width,
		
		color:Globals.foreColor
	});
	
	btSeeLecture.addEventListener('click',function()
	{
		 if (Ti.Network.online) {
		 	Ti.App.fireEvent('LectureDetail:btSeeLecture')
		 	/*
			if(Ti.App.Properties.getInt('isLogin')==1)
			{
				 Ti.App.fireEvent('LectureDetail:btSeeLecture')
			}
			else{
				GetLoginPop(1)
			}
			*/
		 }
		 else
		 {
		  	   require('settings').createAlertConnectError();
		 }
		
	})
	
	view_button.add(btSeeLecture)
	
	var btDownloadLecture = Titanium.UI.createButton({
		
		title:Globals.btAddToDownload,
		font:{
								fontSize:Ti.App.Properties.getString('fontsizeDefault')//,
								//fontWeight:'bold'
			},
		backgroundImage:aps+Globals.backgroundImage_button,
		backgroundSelectedImage:aps+Globals.backgroundSelectedImage,
		backgroundDisabledImage: aps+Globals.backgroundDisabledImage,
		width:(Titanium.Platform.displayCaps.platformWidth)/4,//btwidth	,
		height:_args.btheight_button	,
		left:2*btSeeLecture.width,
		color:Globals.foreColor
		
	});
	btDownloadLecture.addEventListener('click',function()
	{
		 if (Ti.Network.online) {
			if(Ti.App.Properties.getInt('isLogin')==1)
			{
				 Ti.App.fireEvent('LectureDetail:btDowloadLecture')
			}
			else{
				GetLoginPop(2)
			}
		 }
		 else
		 {
		  	   require('settings').createAlertConnectError();
		 }
		
	})
	view_button.add(btDownloadLecture)
	
	
	var btLike = Titanium.UI.createButton({
		title:Globals.btLike_popup,
		font:{
								fontSize:Ti.App.Properties.getString('fontsizeDefault')//,
								//fontWeight:'bold'
			},
		backgroundImage:aps+Globals.backgroundImage_button,
		backgroundSelectedImage:aps+Globals.backgroundSelectedImage,
		backgroundDisabledImage: aps+Globals.backgroundDisabledImage,
		width:(Titanium.Platform.displayCaps.platformWidth)/4,//btwidth	,
		height:_args.btheight_button	,
		left: 3*btDownloadLecture.width	,
		color:Globals.foreColor
	});
	btLike.addEventListener('click',function()
	{
		 if (Ti.Network.online) {
			if(Ti.App.Properties.getInt('isLogin')==1)
			{
				 Ti.App.fireEvent('LectureDetail:btLike')
			}
			else{
				GetLoginPop(3)
			}
		 }
		 else
		 {
		  	   require('settings').createAlertConnectError();
		 }
		
	})
	view_button.add(btLike)
	
	view.add(view_button)
	view.add(view_Info);
	return view;
};